﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Infrastructure
{
    /// <summary>
    /// 执行结果
    /// </summary>
    public class Result
    {
        public Result()
        {
            this.isSuccess = false;
        }
        /// <summary>
        /// 是否成功
        /// </summary>
        public bool isSuccess { get; set; }
        /// <summary>
        /// 消息内容
        /// </summary>
        public string msg { get; set; }
        /// <summary>
        /// 数据
        /// </summary>
        public object data { get; set; }
        /// <summary>
        /// 唯一标识
        /// </summary>
        public object id { get; set; }
        /// <summary>
        /// 返回链接
        /// </summary>
        public string url { get; set; }

        /// <summary>
        /// 总行数
        /// </summary>
        public int count { get; set; }

        public object model { get; set; }

        public object data1 { get; set; }

        public object data2 { get; set; }

        public static Result Success(string message = "")
        {
            return new Result
            {
                isSuccess = true,
                msg = message
            };
        }

        public static Result Failure(string message)
        {
            return new Result
            {
                isSuccess = false,
                msg = message
            };
        }

    }
}
